package com.example.zuoye.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.zuoye.R;
import com.example.zuoye.bean.TagTravel;

import java.util.List;

public class FormAdapter extends BaseQuickAdapter<TagTravel, BaseViewHolder> {
    public FormAdapter(int layoutResId, @Nullable List<TagTravel> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, TagTravel item) {
        helper.setText(R.id.tv,item.getTravels_title());
        Glide.with(mContext).load(item.getTravels_img())
        .apply(RequestOptions.placeholderOf(R.drawable.a6))
        .apply(RequestOptions.errorOf(R.drawable.a6)).into(
                (ImageView)helper.getView(R.id.iv));
    }
}
